import service from '@/utils/request'

// 前端适配
export const useSmTaskApi = (taskId: string) => { // 修改参数名
	return service.get('/sm/task', { params: { taskId } })
  }
// 创建普通作业
export const useSmTaskSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/sm/task', dataForm)
	} else {
		return service.post('/sm/task', dataForm)
	}
}
// 创建素描作业
export const saveSketchTask = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/sm/task/sketch', dataForm)
	} else {
		return service.post('/sm/task/sketch', dataForm)
	}
}

// 查看素描作业详情
export const getSketchTaskDetail = (taskId: string) => {
	return service.get('/sm/task/sketch', { params: { taskId } })
}

// 学生端提交测评素描作业
export const saveStuSketchTask = (dataForm: any) => {
		return service.post('/sm/task/stu/sketch', dataForm)
}

// 学生端-查看素描作业详情
export const getStuSketchTaskDetail = (taskId: string) => {
	return service.get('/sm/task/stu/sketch', { params: { taskId } })
}